package com.hhy.hhy_weibo.controller;

import com.hhy.hhy_weibo.common.api.ApiResult;
import com.hhy.hhy_weibo.model.domain.BmsPromotion;
import com.hhy.hhy_weibo.serviec.IBmsPromotionService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/promotion")
public class BmsPromotionController extends BaseController{

    @Resource
    private IBmsPromotionService iBmsPromotionService;

    @GetMapping("/all")
    public ApiResult<List<BmsPromotion>> getNotices() {
        List<BmsPromotion> list = iBmsPromotionService.list();
        return ApiResult.success(list);
    }

    @DeleteMapping("/delete/{id}")
    public ApiResult<String> delete(@PathVariable("id") String id) {
        iBmsPromotionService.removeById(id);
        return ApiResult.success(null,"推广删除成功");
    }

    @PostMapping("add_promotion")
    public ApiResult<String> addPromotion() {
        return null;
    }

}
